<template>
	<public-view navType="other" navTitle="意见反馈">
		<view class="content f-d-c a-i-c flex">
			<view class="form-view">
				<view class="textarea-box">
					<view class="title f-s-28 color-333 f-w-b line-h-40">
						反馈问题描述
					</view>
					<textarea name="" v-model="content" class="text-area f-s-28" placeholder-style="color:#b4b4b4;" placeholder="请输入您要反馈的问题"></textarea>
				</view>
				<view class="textarea-box flex a-i-c">
					<view class="title f-s-28 color-333 f-w-b line-h-40" style="margin: 0;">
						联系方式
					</view>
					<input class="margin-r f-s-24" v-model="mobile" type="number" placeholder-class="color-999" placeholder="请留下您的联系方式" />
				</view>
				<bottom-btn :positon="false" btnIndex="2" @click="postMsg">提交</bottom-btn>
			</view>
			<view class="color-878787 f-s-24">
				感谢您的反馈 我们会尽快解决您提出的问题～
			</view>
		</view>
	</public-view>
</template>

<script>
	import bottomBtn from "@/components/myComponents/bottomBtn.vue"
	export default {
		components:{
			"bottom-btn":bottomBtn
		},
		data() {
			return {
				content:"",
				mobile:"",
				is_post:''
			};
		},
		methods:{
			postMsg(){
				let that = this
				if(that.content === ''){
					uni.showToast({
						title:"请输入反馈内容",
						icon:"none"
					})
					return
				}
				if(that.mobile === ''){
					uni.showToast({
						title:"请输入联系方式",
						icon:"none"
					})
					return
				}
				if(that.is_post !== ''){
					return
				}
				that.is_post = '1'
				that.util.postRequest({
					url:"v1/feedback/edit",
					data:{
						content:that.content,
						mobile:that.mobile
					}
				}).then(res=>{
					that.is_post = ''
					uni.showToast({
						title:"提交成功"
					})
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.margin-r{
		margin-left: 26upx;
	}
	.form-view{
		width: 100%;
		padding: 0 30upx;
		.textarea-box{
			background: #FFFFFF;
			border-radius: 20upx;
			padding: 32upx 40upx;
			margin-bottom: 24upx;
			.text-area{
				width: 100%;
				height: 240upx;
				border-radius: 20upx;
				background-color: #fafafa;
				padding: 28upx 42upx;
			}
			.title{
				margin-bottom: 24upx;
			}
		}
	}
	.content{
		width: 750upx;
		padding-top: 34upx;
	}
</style>
